package com.hua.yuan.live.repertory;

import com.hua.yuan.live.repertory.business.IBusiness;
import com.hua.yuan.live.repertory.business.ReservationBusiness;

import java.util.HashMap;
import java.util.Map;

/**
 * 业务工厂类
 */
public class BusinessFactory {

    private static BusinessFactory mFactory;

    private Map<Integer,IBusiness> iBusinessMap=new HashMap();

    public static BusinessFactory getInstance(){

        if(mFactory==null){
            mFactory=new BusinessFactory();
        }
        return mFactory;
    }


    private  BusinessFactory(){
        iBusinessMap.put(1,new ReservationBusiness());
    }


    public IBusiness getBusiness(Integer key){
        return iBusinessMap.get(key);
    }
}
